﻿using AttributeRouting.Web.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Water.Model;

namespace Water.RestService.Controllers
{
    /// <summary>
    /// 阀门故障维修记录查询
    /// </summary>
    public class ValveFaultRepairController : ApiController
    {
        private ValveFaultRepair vfr;

        [POST("GetValveFaultRepairs")]
        public IList<ValveFaultRepair> PostGetValveFaultRepairs(ValveFaultCondition vfc)
        {
            vfr = new ValveFaultRepair();
            return vfr.GetValveFaultRepairs(vfc);
        }
        /*
        [POST("GetValveFaultRepairsCount")]
        public int PostGetValveFaultRepairsCount(ValveFaultRepair info)
        {
            var where = ValveFaultRepairWhere(info);
            int count = rep.LoadCount(where);
            return count;
        }
        */

        [POST("AddValveFaultRepair")]
        public bool PostAddValveFaultRepair(ValveFaultRepair info)
        {
            info.MRNO = BuilderMrno.GetMrnoFortbl("Tbt_ValveFaultRepair");
            vfr = new ValveFaultRepair();
            bool result = vfr.AddValveFaultRepair(info) > 0 ? true : false;
            return result;
        }

        /*
        [POST("EditValveFaultRepair")]
        public bool PostEditValveFaultRepair(ValveFaultRepair info)
        {
            bool result = rep.Edit(info);
            return result;
        }

        [GET("DeleteValveFaultRepair/{code}")]
        public bool GetDeleteValveFaultRepair(string code)
        {
            bool result = rep.Delete(code);
            return result;
        }

        [GET("GetValveFaultRepair/{code}")]
        public ValveFaultRepair GetValveFaultRepair(string code)
        {
            var result = rep.Get(code);
            return result;
        }
         * */
    }
}
